package org.czl.LeetCode;

import java.util.HashSet;

public class l3295 {
    class Solution {
        public boolean reportSpam(String[] message, String[] bannedWords) {
            HashSet<String> set = new HashSet<>();
            for(String s : bannedWords){
                set.add(s);
            }
            int ans = 0;
            for(String s : message){
                if(set.contains(s)){
                    ans++;
                    if(ans == 2)return true;
                }
            }
            return false;
        }
    }
}
